package com.weng.coder.service;

import javax.servlet.http.HttpServletRequest;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.weng.coder.entity.CodeTable;
import com.weng.coder.entity.Field;
import com.weng.framework.core.model.ResponseData;
import org.springframework.ui.Model;

import java.util.List;

/**
 * 表 业务实现接口
 *
 * @作者 wengzhonghui
 * @创建时间 2018-02-24 17:16:11
 */
public interface CodeTableService {

	List<CodeTable> findByIds(List<String> ids);

	CodeTable save(CodeTable t);

	void delete(String id);


	int deleteByProjectId(String projectId);

	IPage<CodeTable> getDataByPage(int pageNo, int pageSize, CodeTable obj);

	void delete(CodeTable t);

	CodeTable getOne(String id);

	void delete(Iterable<CodeTable> entities);

	void deleteByIds(String[] ids);

	/**
	 * 通过SQL新建表对象和列对象
	 * @param projectId
	 * @param area
	 * @param sql
	 * @param model
	 * @param request
	 * @return
	 */
	ResponseData addCodeTableAndFieldsBySql(String projectId, String area, String sql, Model model
					,String entityName, String methodName, String methodType, String remark, HttpServletRequest request);
}
